﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};
	
	var httypeData = Jxstar.findComboData('httype');
	var auditData = Jxstar.findComboData('audit');
	var items = [{
		height: '97%',
		width: '97%',
		border: false,
		layout: 'form',
		style: 'padding:10px;',
		items: [{
			anchor:'100%',
			border: false,
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'trigger', fieldLabel:'合同编号', name:'contract_change__contract_code',
						anchor:'100%', triggerClass:'x-form-search-trigger',
						maxLength:20, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', editable:false,
						onTriggerClick: function() {
							var selcfg = {pageType:'combogrid', nodeId:'contract_select', layoutPage:'', sourceField:'contract.contract_money', targetField:'contract_change.before_money', whereSql:"contract_status='4'", whereValue:'', whereType:'', isSame:'1', isShowData:'1', isMoreSelect:'0',isReadonly:'1',fieldName:'contract_change.contract_code'};
							JxSelect.createSelectWin(selcfg, this, 'node_contract_change_form');
						}},
					{xtype:'textfield', fieldLabel:'合同名称', name:'contract_change__contract_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'textfield', fieldLabel:'项目名称', name:'contract_change__project_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'textfield', fieldLabel:'实施单位', name:'contract_change__dept_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'变更前金额(万元)', name:'contract_change__before_money', defaultval:'0', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'textfield', fieldLabel:'变更申请人', name:'contract_change__change_user', defaultval:'fun_getUserName()', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'combo', fieldLabel:'合同类型', name:'contract_change__contract_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: httypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: httypeData[0][0]},
					{xtype:'hidden', fieldLabel:'主键', name:'contract_change__change_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'实施单位ID', name:'contract_change__dept_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'合同ID', name:'contract_change__contract_id', anchor:'100%'}
				]
			},{
				border:false,
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'combo', fieldLabel:'记录状态', name:'contract_change__auditing', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: auditData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: auditData[0][0]},
					{xtype:'textfield', fieldLabel:'项目编号', name:'contract_change__project_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'项目负责人', name:'contract_change__project_user', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'合同签约部门', name:'contract_change__done_deptname', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'变更后金额(万元)', name:'contract_change__after_money', defaultval:'0', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:12},
					{xtype:'datefield', fieldLabel:'变更日期', name:'contract_change__change_date', defaultval:'fun_getToday()', format:'Y-m-d', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目ID', name:'contract_change__project_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目负责人ID', name:'contract_change__project_userid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'变更申请人ID', name:'contract_change__change_userid', defaultval:'fun_getUserId()', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'合同签约部门ID', name:'contract_change__done_deptid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'授权形式', name:'contract_change__auth_type', anchor:'100%'}
				]
			}
			]
		},{
			anchor:'100%',
			border: false,
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				columnWidth:0.99,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textarea', fieldLabel:'变更原因', name:'contract_change__change_cause', width:'100%', height:48, maxLength:600},
					{xtype:'textarea', fieldLabel:'变更内容', name:'contract_change__change_content', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', width:'100%', height:48, maxLength:500},
					{xtype:'textarea', fieldLabel:'备注', name:'contract_change__comments', width:'100%', height:48, maxLength:200}
				]
			}
			]
		}]
	}];
	
	config.param = {
		items: items,
		funid: 'contract_change'
	};

	
	
	return new Jxstar.FormNode(config);
}